﻿<phone:PhoneApplicationPage xmlns:my1="clr-namespace:EbbinghausWord.Controls"  xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"  
    x:Class="EbbinghausWord.Pages.ReviewWordPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    
    Loaded="PhoneApplicationPage_Loaded"
    Unloaded="PhoneApplicationPage_Unloaded" 
    shell:SystemTray.IsVisible="True" mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480">
    <phone:PhoneApplicationPage.Resources>
        <Style x:Key="normalButton" TargetType="Button">
            <Setter Property="Height" Value="100"/>
            <Setter Property="Width" Value="200"/>
        </Style>

        <Style x:Key="smallTitleTextBlock" TargetType="TextBlock">
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="TextAlignment" Value="Right"/>
        </Style>

        <Style x:Key="otherTextBlock" TargetType="TextBlock">
            <Setter Property="FontSize" Value="22"/>
            <Setter Property="TextWrapping" Value="Wrap"/>
        </Style>
    </phone:PhoneApplicationPage.Resources>
 
    <!--<controls:Panorama.TitleTemplate>
            <DataTemplate>
            </DataTemplate>
        </controls:Panorama.TitleTemplate>-->

    <!--中文-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="70"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="100"/>
        </Grid.RowDefinitions>

        <!--标题栏-->
        <Grid x:Name="TitlePanel" Grid.Row="0" Margin="12,0,12,0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <TextBlock x:Name="ApplicationTitle" Text="{StaticResource appTitle}" 
                       Style="{StaticResource PhoneTextNormalStyle}" Grid.ColumnSpan="2" 
                       Margin="0" />
            <TextBlock Name="wordbookTextBlock" Grid.Row="1" Grid.Column="0" 
                       Text="学习/复习" TextAlignment="Center"
                       Style="{StaticResource smallTitleTextBlock}"/>
            <TextBlock Name="remeberLevelTextBlock" Grid.Row="1" Grid.Column="1" 
                       Text="1/20" Style="{StaticResource smallTitleTextBlock}"/>
            <TextBlock Name="totalTextBlock" Grid.Row="0" Grid.Column="1" 
                       Text="1000/4000" Style="{StaticResource smallTitleTextBlock}"/>
        </Grid>

        <!--单词内容区域-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12">
            <ScrollViewer VerticalScrollBarVisibility="Visible">
                <StackPanel Margin="0" ScrollViewer.VerticalScrollBarVisibility="Visible">

                    <!--英文及发音图标-->
                    <Grid HorizontalAlignment="Center" MouseLeftButtonDown="voiceImage_MouseLeftButtonDown">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="60"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Name="workTextBlock" TextAlignment="Center"
                                    FontSize="36" Text="{Binding Path=English}"/>
                        <Image x:Name="voiceImage" Grid.Column="1" Source="/Images/voice.png" Height="48" Width="48" />

                        <MediaElement x:Name="MainME" AutoPlay="False" Volume="1" MediaFailed="MainME_MediaFailed"
                                  MediaOpened="MainME_MediaOpened" MediaEnded="MainME_MediaEnded"></MediaElement>
                    </Grid>

                    <StackPanel Margin="0,10,0,0" >
                        <!--中文面板-->
                        <StackPanel Name="chinesePanel" Visibility="Collapsed" >
                            <!--ManipulationDelta="chinesePanel_ManipulationDelta"
                                    MouseLeftButtonUp="chinesePanel_MouseLeftButtonUp"
                                    MouseLeftButtonDown="chinesePanel_MouseLeftButtonDown">-->
                            <!--Background="Green">-->

                            <!--音标-->
                            <TextBlock Name="soundmarkTextBlock" Margin="0" 
                                        FontSize="24" Text="{Binding Path=Soundmark}"/>

                            <!--释义-->
                            <Border Background="Green">
                                <TextBlock Text="释义" Style="{StaticResource otherTextBlock}"/>
                            </Border>
                            <TextBlock Name="chineseTextBlock" TextWrapping="Wrap" Margin="10,0,0,0"
                                       Style="{StaticResource otherTextBlock}" Text="{Binding Path=Chinese}"/>

                            <!--同义词-->
                            <StackPanel x:Name="synonmyLStackPanel">
                                <Border Background="Green">
                                    <TextBlock Text="同义词" Style="{StaticResource otherTextBlock}"/>
                                </Border>
                                <ListBox x:Name="synonmyListBox" Margin="10,0,0,0" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                                    <ListBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Vertical">
                                                <TextBlock Text="{Binding Path=English}" Style="{StaticResource otherTextBlock}"/>
                                                <TextBlock Text="{Binding Path=Chinese}" Margin="5,0,0,10" Style="{StaticResource otherTextBlock}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>
                                </ListBox>
                            </StackPanel>

                            <!--词组-->
                            <StackPanel x:Name="wordGroupStackPanel">
                                <Border Background="Green">
                                    <TextBlock Text="词组" Style="{StaticResource otherTextBlock}"/>
                                </Border>
                                <ListBox x:Name="wordGroupListBox" Margin="10,0,0,0" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                                    <ListBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Vertical">
                                                <TextBlock Text="{Binding Path=English}" Style="{StaticResource otherTextBlock}"/>
                                                <TextBlock Text="{Binding Path=Chinese}" Margin="5,0,0,10" Style="{StaticResource otherTextBlock}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>
                                </ListBox>
                            </StackPanel>

                            <!--例句-->
                            <StackPanel x:Name="sentenceStackPanel">
                                <Border Background="Green">
                                    <TextBlock Text="例句" Style="{StaticResource otherTextBlock}"/>
                                </Border>
                                <ListBox x:Name="sentenceListBox" Margin="10,0,0,0" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                                    <ListBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Vertical">
                                                <TextBlock Text="{Binding Path=English}" Style="{StaticResource otherTextBlock}"/>
                                                <TextBlock Text="{Binding Path=Chinese}" Margin="5,0,0,10" Style="{StaticResource otherTextBlock}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>
                                </ListBox>
                            </StackPanel>
                        </StackPanel>

                        <!--显示中文的按钮-->
                        <Button Name="ShowChineseButton" Height="200" Width="420" Content="显示中文" Click="ShowChinese_Click" />
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </Grid>

        <!--广告-->
        <!--<my:AdControl Grid.Row="2" Height="80" Width="480" 
                      ApplicationId="21c4e14f-ac5c-4ba6-b6e0-fa527394c50f" 
                      AdUnitId="81646"
                      VerticalAlignment="Bottom"/>-->

        <!--按钮栏-->
        <Grid Name="buttonPanel" Grid.Row="2" Width="440" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Button Name="ForgetWordButton" Grid.Column="0" Content="没记住"  Style="{StaticResource normalButton}" Click="ForgetWordButton_Click" />
            <Button Name="RemeberWordButton" Grid.Column="1" Content="记住了" Style="{StaticResource normalButton}" Click="RemeberWord_Click" />
        </Grid>

        <my1:HintControl Grid.RowSpan="3" x:Name="hintControl"/>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="removeWordBarIconButton" IconUri="/Images/remove.png" Text="排除单词" Click="CompleteRemeberButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="studyAchievementBarIconButton" IconUri="/Images/achievement.png" Text="学习成果" Click="studyAchievementBarIconButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="scoreBarIconButton" IconUri="/Images/score.png" Text="预测成绩" Click="scoreBarIconButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="optionBarIconButton" IconUri="/Images/option.png" Text="设置" Click="OptionClick"/>
            <!--<shell:ApplicationBarIconButton x:Name="testButton" Text="测试" IconUri="/Images/test.png" Click="testButton_Click"/>-->
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="设置" Click="OptionClick"/>
                <shell:ApplicationBarMenuItem Text="极速背单词" Click="ad_Click"/>
                <shell:ApplicationBarMenuItem Text="关于" Click="AboutClick"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>